<?php
echo $this->adminToolBar('roomcategory', 'index', '/admin/roomcats/add/', '/admin/roomcats/edit/', '/admin/roomcats/delete/', '');
?>
<?php         
$this->title = "Room Category";
$this->headTitle($this->title);
?>
<div class="mid-content" id="grid_newsletter"> 
	<table class="box-table-a" width="100%"> 
		<tr>
			<th scope="col" width="40%"><b>Room Category</b></th>
			<th scope="col" width="40%"><b>Room Type</b></th>
			<th scope="col" width="10%">&nbsp;</th>
			<th scope="col" width="10%">&nbsp;</th>
		</tr>
		<?php 
			foreach($this->roomcats_arr as $roomcats_entry) :
				$room_type_arr = $roomcats_entry['room_type'];
				$room_type_arr = explode("|", $room_type_arr);
				
				//$room_types = ucfirst($room_type_arr[0]) . "<br />" . ucfirst($room_type_arr[1]) . "<br />" . ucfirst($room_type_arr[2]);
				$room_types = "";
				if(!empty($room_type_arr[0])) {
					$room_types = ucfirst($room_type_arr[0]);
				}
				if(!empty($room_type_arr[1])) {
					$room_types .= "<br />" . ucfirst($room_type_arr[1]);
				}
				if(!empty($room_type_arr[2])) {
					$room_types .= "<br />" . ucfirst($room_type_arr[2]);
				}
		?>
		<tr>
		    <td valign="top"><?php echo $roomcats_entry['roomcat_type']; ?></td>
		    <td><?php echo $room_types; ?></td>
		
		    <td align="center" valign="top">
		        <a href="javascript: void(0);" onclick="loadPage('/admin/roomcats/edit/roomcat_id/<?php echo $roomcats_entry['roomcat_id']; ?>');" title="Edit"><img src="/images/admin/icons/edit.gif" alt=""/></a>          
		     </td> 
		     <td align="center" valign="top">
		     	<a rel="" onclick="deleteRoomCat('<?php echo $roomcats_entry['roomcat_id'];?>')" href="javascript: void(0);"><img src="/images/admin/icons/disable.gif" alt=""/></a>
		     </td>  
		</tr>
		<?php endforeach; ?>
	</table>
</div>
